USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[CUSTOMER]    Script Date: 13-May-14 1:01:08 AM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[CUSTOMER](
	[CUSTOMER_ID] [int] IDENTITY(1,1) NOT NULL,
	[VILLAGE_ID] [int] NOT NULL,
	[CUSTOMER_NAME] [varchar](50) NOT NULL,
	[CONTACT_NO_1] [bigint] NOT NULL,
	[CONTACT_NO_2] [bigint] NULL,
	[CUSTOMER_ADDRESS] [varchar](max) NOT NULL,
	[CUSTOMER_EMAIL] [varchar](50) NULL,
	[STATUS_ID] [int] NOT NULL,
 CONSTRAINT [PK_CUSTOMER] PRIMARY KEY CLUSTERED 
(
	[CUSTOMER_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[CUSTOMER]  WITH CHECK ADD  CONSTRAINT [FK_CUSTOMER_MASTER] FOREIGN KEY([STATUS_ID])
REFERENCES [dbo].[MASTER] ([MASTER_ID])
GO

ALTER TABLE [dbo].[CUSTOMER] CHECK CONSTRAINT [FK_CUSTOMER_MASTER]
GO

ALTER TABLE [dbo].[CUSTOMER]  WITH CHECK ADD  CONSTRAINT [FK_CUSTOMER_VILLAGES] FOREIGN KEY([VILLAGE_ID])
REFERENCES [dbo].[VILLAGES] ([VILLAGE_ID])
GO

ALTER TABLE [dbo].[CUSTOMER] CHECK CONSTRAINT [FK_CUSTOMER_VILLAGES]
GO


